import java.util.HashMap;
import java.util.Scanner;
import java.util.Vector;


public class defs {
	static String MULTICAST_ADDR = "224.0.2.10";
	static int CTRL_PORT = 8967;
	static int DATA_PORT = 8966;
	static String SID;
	static HashMap<String, Vector<Long>> RequestedFiles = new HashMap<String, Vector<Long>>();
	static HashMap<String, P2PPartFile> writeFiles = new HashMap<String, P2PPartFile>();
	
	public static Vector<Long> ParseChunks(String chunks) {
		Vector<Long> chunkvector = new Vector<Long>();
    	Scanner sc = new Scanner(chunks);
    	
    	if (!chunks.contains("-")) {
        	sc.useDelimiter(",");
        	while (sc.hasNextLong()) {
        		chunkvector.add(sc.nextLong());
        	}   		
    	}
    	else
    	{
    		sc.useDelimiter("-");   
    		long min=sc.nextLong();
    		long max=sc.nextLong();
    		for (long i=min;i<=max;i++)
    		{
    			chunkvector.add(i);
    		}
    	}

    	return chunkvector;
	}
}
